Skip to content

fix: authorize every SELECT source - #19

Merged
marianfoo merged 10 commits into
masterfrom
codex/fix-base-sec-003
Aug 6, 2026
Merged

marianfoo merged 10 commits into
masterfrom
codex/fix-base-sec-003

Conversation

@marianfoo

@marianfoo marianfoo commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

Goal

Close BASE-SEC-003 by applying the existing table authorization policy to every provable physical SELECT source, including nested subqueries and later UNION/UNION ALL sources.

Changes

  • add a quote-aware physical-source scanner
  • check every unique FROM/JOIN source with the unchanged authorization object or fallback policy
  • reject a backslash anywhere in a source token, covering detached and attached path expressions
  • reject only the exact HIERARCHY constructor while preserving real HIERARCHY_* table names
  • record parenthesized joins as an intentional fail-closed limitation
  • prove that UNION ALL cannot hide a later unauthorized source
  • distinguish scanner-level comment rejection from the editor path that normally strips ordinary line comments
  • preserve the complete PR fix!: retire arbitrary Native SQL execution #18 Native-SQL-removal and PR fix: guard generated ABAP fragments #20 generated-fragment-hardening production/test corpus after a semantic rebase
  • replace volatile lint/ATC totals in the long-lived development playbook with dated findings-register evidence

TDD and review evidence

The finished plan is docs/plans/finished/base-sec-003.md. Against the original production code, the first test-only A4H run passed 22/26 tests and failed exactly the four intended nested/dynamic boundaries. External review then identified the SAP-documented attached path form: a second test-only replay passed 32/34 and failed exactly REJECTS_ATTACHED_PATH_SOURCE and ACCEPTS_HIERARCHY_NAMED_TABLE. No SQL was executed for either security proof.

PR #18 and PR #20 were merged first. This branch was then rebased onto their final master state, overlapping source/docs were resolved semantically, and every affected local/A4H gate was repeated on the integrated candidate rather than carrying forward branch-local evidence.

Exact integrated validation

Final head: aa2ec789ef173d4244db0168d12d557bd71a7ebc.

  • npm ci, npm test, npm run lint:quality, and git diff --check
  • configured abaplint: 0 findings
  • diagnostic full profile: 2,030 findings across 59 rules (non-blocking debt inventory)
  • exact source SHA-256: 339a53f579fcde6b95dee08841a421fbe510839d06113902c800b6c28eee5397
  • A4H server-normalized SHA-256: 46789b7a44ac06953e9a69a03f19199d6192ebf10327aa24c3e13c77d1e9c654
  • A4H activation and syntax: 0 errors, 2 pre-existing POSIX warnings
  • A4H ABAP Unit: 55/55; 25.07% statement, 24.10% branch, 16.87% procedure coverage
  • A4H ABAP_CLOUD_READINESS: 668 findings (462 P1, 206 P2)
  • A4H S4HANA_READINESS_2023: no rows, but incomplete because prerequisite checks are unavailable
  • fresh A4H FLP/WebGUI editor and DDIC startup: no browser error, SQL execution, or ST22 delta
  • active/inactive A4H source comparison: no divergence
  • ABAP 7.50 probed through ARC-1/ADT only; exact ZTOAD validation remains prerequisite-blocked because PROG/TABL ZTOAD are absent on NPL
  • GitHub Actions Quality run 31116086378: passed; external abaplint passed and observations were informational/skipped as configured

Final review

Outcome: fixed. No provable physical SELECT source reaches generation without the existing activity/table policy; unprovable forms fail closed. Parenthesized joins remain a documented functional limitation until their grammar is modeled. Missing GUI status STATUS010 remains the independent BASE-BUG-007 installation issue and did not invalidate the safe startup smoke.

Release note

Prevent nested, attached-path, and otherwise unprovable SELECT sources from bypassing ZTOAD table authorization.

@marianfoo
marianfoo marked this pull request as ready for review August 6, 2026 13:21
@marianfoo
marianfoo force-pushed the codex/fix-base-sec-003 branch from 550ad6e to aa2ec78 Compare August 6, 2026 15:29
@marianfoo
marianfoo merged commit 1bf2d4d into master Aug 6, 2026
3 checks passed
@marianfoo
marianfoo deleted the codex/fix-base-sec-003 branch August 6, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant